import { lazy } from 'react';
import NameList from './NameList';
import NameListEdit from './NameList/Edit';
import NameListDetail from './NameList/Detail';
import NameListConfig from './NameListConfig';
import RiskType from './RiskType';
import Tag from './Tag';
import Fn from './Fn';
import Var from './Var';

const variableRouter = [
  {
    path: '/variable/tag',
    name: '标签管理',
    des: '',
    component: window.__POWERED_BY_QIANKUN__ ? Tag : lazy(() => import('./Tag')),
    exact: true,
  },
  {
    path: '/variable/riskType',
    name: '风险类型管理',
    des: '定义不同的风险类型可以在配置策略时使用，命中策略后可以以不同的风险维度查看可视化数据。',
    component: window.__POWERED_BY_QIANKUN__ ? RiskType : lazy(() => import('./RiskType')),
    exact: true,
  },
  {
    path: '/variable/var',
    name: '变量管理',
    des: '字段是风控系统内最小的单位，如IP地址、转账金额等，系统字段全局可见，自定义字段在指定事件下可见',
    component: window.__POWERED_BY_QIANKUN__ ? Var : lazy(() => import('./Var')),
    exact: true,
  },
  {
    path: '/variable/indicator',
    name: '指标定义',
    des: '',
    component: lazy(() => import('./Indicator')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/indicator/:id/version',
    name: '指标定义版本',
    des: '',
    component: lazy(() => import('./Indicator/Versions')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/indicator/statistic',
    name: '指标统计',
    des: '',
    component: lazy(() => import('./Indicator/Statistic')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/computeMode',
    name: '计算方式管理',
    des: '',
    component: lazy(() => import('./ComputeMode')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/field',
    name: '字段管理',
    des: '字段是风控系统内最小的单位，如IP地址、转账金额等，系统字段全局可见，自定义字段在指定事件下可见',
    component: lazy(() => import('./Field')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/nameList',
    name: '名单管理',
    des: '通过名单管理您可以添加名单或对名单内数据进行增删改查等操作，丰富的名单可以为风控系统赋能。',
    component: window.__POWERED_BY_QIANKUN__ ? NameList : lazy(() => import('./NameList')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/nameList/:id/edit',
    name: '编辑名单',
    des: '',
    component: window.__POWERED_BY_QIANKUN__ ? NameListEdit : lazy(() => import('./NameList/Edit')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/nameList/:id/detail',
    name: '名单详情',
    des: '',
    component: window.__POWERED_BY_QIANKUN__ ? NameListDetail : lazy(() => import('./NameList/Detail')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/outerList',
    name: '三方名单',
    des: '通过名单管理您可以添加名单或对名单内数据进行增删改查等操作，丰富的名单可以为风控系统赋能。',
    component: lazy(() => import('./OuterList')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/model/index',
    name: '模型调用',
    des: '通过模型可以为决策引擎的规则及阈值提供准确、有效的判断依据，提升决策有效性，提升风控引擎风险识别能力。',
    component: lazy(() => import('./Model/Model')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/model/index/add',
    name: '添加模型',
    des: '',
    component: lazy(() => import('./Model/Model/add')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/model/store',
    name: '模型仓库',
    des: '',
    component: lazy(() => import('./Model/Store')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/model/config',
    name: '模型服务',
    des: '',
    component: lazy(() => import('./Model/Config')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/model/config/:id/detail',
    name: '接口调用监控',
    des: '',
    component: lazy(() => import('../Monitor/DevOps/Api')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/fn/index',
    name: '函数管理',
    des: '',
    component: window.__POWERED_BY_QIANKUN__ ? Fn : lazy(() => import('./Fn')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/fn/index/add',
    name: '新建函数',
    des: '',
    component: lazy(() => import('./Fn/add')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/fn/index/:id/edit',
    name: '编辑函数',
    des: '',
    component: lazy(() => import('./Fn/add')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/indicator/dataSource',
    name: '指标数据源',
    des: '',
    component: lazy(() => import('./Indicator/DataSource')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/map',
    name: '映射管理',
    des: '',
    component: lazy(() => import('./Map')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/map/customParams',
    name: '自定义参数管理',
    des: '',
    component: lazy(() => import('./Map/CustomParams')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/map/customParams/:id/version',
    name: '版本管理',
    des: '',
    component: lazy(() => import('./Map/Version')),
    exact: true,
    auth: true,
  },
  {
    path: '/variable/nameListConfig',
    name: '名单同步配置',
    des: '',
    component: window.__POWERED_BY_QIANKUN__ ? NameListConfig : lazy(() => import('./NameListConfig')),
    exact: true,
    auth: true,
  },
];

export default variableRouter;
